import { PartialType } from '@nestjs/swagger';
import { Decorator_DtoIsNumber_Base } from '@/common/decorators/dtoIsNumber';
import {
  Constant_Enum_Enum_KeyValueStore_Enum_TypeKey,
  IConstant_Enum_Type_KeyValueStore_Enum_TypeKey,
} from '@/common/constants/enum';
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString } from 'class-validator';

export class KeyValueStore_Create_Dto {
  @IsString()
  @IsNotEmpty()
  @ApiProperty({
    description: '键',
    enum: Constant_Enum_Enum_KeyValueStore_Enum_TypeKey,
  })
  storeKey: IConstant_Enum_Type_KeyValueStore_Enum_TypeKey;

  @IsString()
  @IsNotEmpty()
  @ApiProperty({ description: '值' })
  storeValue: string;
}

export class KeyValueStore_Update_Dto extends PartialType(KeyValueStore_Create_Dto) {
  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  id: number;
}
